package com.cet.others.正则测试;

import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2022-04-20 11:34
 **/
public class Test01 {

    private static Pattern COMBINED_STRING =  Pattern.compile("^(\\w+,)*\\w+$");

    public static void main(String[] args) {
        Matcher matcher = COMBINED_STRING.matcher("avasfsda1232432,23432432sddfdsfA");
        System.out.println(matcher.matches());

        ConcurrentHashMap<String, Object> map = new ConcurrentHashMap<>();
        map.put("aaa", 1);
        System.out.println(map.putIfAbsent("aaa", true));
        System.out.println(map.putIfAbsent("bbb", true));
    }
}
